<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>管理员管理页</title>
    <!-- Bootstrap Styles-->
    <link href="__STATIC__/assest/css/bootstrap.css" rel="stylesheet" />
    <!-- FontAwesome Styles-->
    <link href="__STATIC__/assest/css/font-awesome.css" rel="stylesheet" />
    <!-- Morris Chart Styles-->

    <!-- Custom Styles-->
    <link href="__STATIC__/assest/css/custom-styles.css" rel="stylesheet" />
    <!-- Google Fonts-->
    <link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" type="text/css" />
    <!-- TABLE STYLES-->
    <link href="__STATIC__/assest/js/dataTables.bootstrap.css" rel="stylesheet" />
</head>
<body>
<div id="wrapper">
    {include    file="public:nav1"   /}

    {include    file="public:nav"   /}
    <!-- /. NAV SIDE  -->
    <div id="page-wrapper" >
        <div class="header">
            <h1 class="page-header">
                物品管理
            </h1>
            <ol class="breadcrumb">
                <li><a href="#">物品管理</a></li>
                <li><a href="#">香水</a></li>
            </ol>

        </div>

        <div id="page-inner">

            <div class="widget widget-padding span12">
                <div class="widget-header">
                    <i class="icon-group"></i>
                    <h5>视频列表</h5>
                    <div class="widget-buttons">
                        <a href="#" data-title="Add User" data-toggle="modal" data-target="#example_modal"><i class="icon-plus"></i></a>
                        <a href="#" data-title="Collapse" data-collapsed="false" class="collapse"><i class="icon-chevron-up"></i></a>
                    </div>
                </div>
                <div class="widget-body">
                    <table id="users" class="table table-striped table-bordered dataTable">
                        <thead>
                        <tr>
                            <th>编号</th>
                            <th>香水名</th>
                            <th>海报</th>
                            <th>所属类型</th>
                            <th>上传时间</th>
                        </tr>
                        </thead>
                        <tbody>
                        {volist name="clean" id="vo"}
                        <tr>
                            <td>{$i}</td>
                            <td>{$vo.cleanname}</td>
                            <td><img src="__STATIC__/assest/images/{$vo.pic}" style="width:100px"></td>
                            <td>{$vo.typename}</td>
                            <td>{$vo.uploadtime}</td>
                            <td>
                                <div class="btn-group">
                                    <a class="btn btn-small dropdown-toggle" data-toggle="dropdown" href="#">
                                        操作
                                        <span class="caret"></span>
                                    </a>
                                    <ul class="dropdown-menu pull-right">
                                        <!--<li><a href="#"><i class="icon-edit"></i>修改</a></li>-->
                                        <li><a href="#" data-toggle="modal" data-target="#edit_modal" onclick="fullData({$vo.clid},'{$vo.cleanname}',{$vo.tid},'{$vo.pic}','{$vo.intro}','{$vo.uploadtime}')"><i class="icon-edit"></i>修改</a></li>
                                        <li><a href="{:url('delete',['id'=>$vo.clid])}"><i class="icon-trash"></i>删除</a></li>
                                    </ul>
                                </div>
                            </td>
                        </tr>
                        {/volist}
                        </tbody>
                    </table>
                </div> <!-- /widget-body -->
            </div>
            <!-- /. ROW  -->
            <!-- Button trigger modal -->
            <a class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
                添加
            </a>

            <!-- Modal -->
            <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                <div class="modal-dialog" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                            <h4 class="modal-title" id="myModalLabel">添加卸妆信息</h4>
                        </div>
                        <div class="modal-body">
                            <form action="{:url('add')}" method="post" enctype="multipart/form-data">
                                <div class="modal-body">
                                    <div class="form-group">
                                        <label for="exampleInputUserName" class="col-md-2 control-label">卸妆名称</label>
                                        <div class="col-md-10">
                                            <input type="text" name="cleanname" class="form-control" id="exampleInputUserName"
                                                   placeholder="卸妆名称" required>
                                        </div>
                                    </div>
                                    <br>
                                    <div class="form-group">
                                        <label for="exampleInputUserName" class="col-md-2 control-label">物品类型</label>
                                        <div class="col-md-10">
                                            <select name="type" id="tid">
                                                {volist name="types" id="ty"}
                                                <option value="{$ty.tid}">{$ty.typename}</option>
                                                {/volist}
                                            </select>
                                        </div>
                                    </div>
                                    <br>
                                    <div class="form-group">
                                        <label for="exampleInputFile" class="col-md-2 control-label">海报</label>
                                        <div class="col-md-10">
                                            <input type="hidden" name="MAX_FILE_SIZE" value="2097157">
                                            <input type="file" name="pic" id="exampleInputFile" required>
                                        </div>
                                    </div>
                                    <br>

                                    <div class="form-group">
                                        <label for="exampleInputBirth" class="col-md-2 control-label">上传日期</label>
                                        <div class="col-md-10">
                                            <input type="date" name="uploadtime" class="form-control" id="exampleInputBirth"
                                                   placeholder="上传日期" required>
                                        </div>
                                    </div>
                                    <br>

                                    <div class="form-group">
                                        <label for="exampleInputBirth" class="col-md-2 control-label">简介</label>
                                        <div class="col-md-10">
                                            <textarea name="intro" rows="3"></textarea>
                                        </div>
                                    </div>
                                    <br>
                                    <div class="form-group">
                                        <label for="exampleInputBirth" class="col-md-2 control-label">上传者</label>
                                        <div class="col-md-10">
                                            <input name="uploaduser">
                                        </div>
                                    </div>
                                    <br>
                                </div>
                                <br>
                                <div class="modal-footer">
                                    <input type="reset" class="btn" data-dismiss="modal" aria-hidden="true" value="重置">
                                    <input type="submit" class="btn btn-primary" value="保存">
                                </div>
                            </form>
                        </div>

                    </div>
                </div>

            </div>
            <!-- Edit Modal -->
            <div id="edit_modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                <div class="modal-dialog" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal">×</button>
                            <h3 id="editLabel">修改卸妆信息</h3>
                        </div>
                        <div class="modal-body">
                            <form method="post" action="{:url('update')}" enctype="multipart/form-data">
                                <input type="hidden" name="clid" id="eclid">
                                <div class="modal-body">
                                    <div class="form-group">
                                        <label for="exampleInputUserName" class="col-md-2 control-label">卸妆名称</label>
                                        <div class="col-md-10">
                                            <input type="text" name="cleanname" class="form-control" id="elname"
                                                   placeholder="卸妆名称" required>
                                        </div>
                                    </div>
                                    <br>
                                    <div class="form-group">
                                        <label for="exampleInputUserName" class="col-md-2 control-label">类型</label>
                                        <div class="col-md-10">
                                            <select name="type" id="etid">
                                                {volist name="types" id="ty"}
                                                <option value="{$ty.tid}">{$ty.typename}</option>
                                                {/volist}
                                            </select>
                                        </div>
                                    </div>
                                    <br>
                                    <div class="form-group">
                                        <label for="exampleInputFile" class="col-md-2 control-label">海报</label>
                                        <div class="col-md-10">
                                            <input type="hidden" name="MAX_FILE_SIZE" value="2097157">
                                            <input type="file" name="pic">
                                            <img src="" id="epic" style="width: 300px;height: 512px important">
                                        </div>
                                    </div>

                                    <br>
                                    <div class="form-group">
                                        <label for="exampleInputBirth" class="col-md-2 control-label">上传日期</label>
                                        <div class="col-md-10">
                                            <input type="date" name="uploadtime" class="form-control" id="euploadtime"
                                                   placeholder="上传日期" required>
                                        </div>
                                    </div>
                                    <br>
                                    <div class="form-group">
                                        <label for="exampleInputBirth" class="col-md-2 control-label">简介</label>
                                        <div class="col-md-10">
                                            <textarea id="eintro" name="intro" rows="3"></textarea>
                                        </div>
                                    </div>
                                </div>
                                <br>
                                <div class="modal-footer">
                                    <input type="reset" class="btn" data-dismiss="modal" aria-hidden="true" value="重置">
                                    <input type="submit" class="btn btn-primary" value="保存">
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
            <footer><p>15110100508陈嘉兴  15110100505金生 15110100527韩冬乐</p></footer>
        </div>
        <!-- /. PAGE INNER  -->

    </div>
    <!-- /. PAGE WRAPPER  -->
    <!-- /. WRAPPER  -->
    <!-- JS Scripts-->
    <!-- jQuery Js -->
    <script src="__STATIC__/assest/js/jquery-1.10.2.js"></script>
    <!-- Bootstrap Js -->
    <script src="__STATIC__/assest/js/bootstrap.min.js"></script>
    <!-- Metis Menu Js -->
    <script src="__STATIC__/assest/js/jquery.metisMenu.js"></script>
    <!-- DATA TABLE SCRIPTS -->
    <script src="__STATIC__/assest/js/jquery.dataTables.js"></script>
    <script src="__STATIC__/assest/js/dataTables.bootstrap.js"></script>
    <script>
        $(document).ready(function () {
            $('#dataTables-example').dataTable();
        });
    </script>
    <script>
        function fullData(clid,cleanname,tid,pic,intro,uploadtime)
        {
            document.getElementById("eclid").value=clid;
            document.getElementById("elname").value=perfumename;
            var seclction=document.getElementById("etid");
            for(var i=0;i<seclction.length;i++)
            {
                if(seclction[i].value==tid)
                {
                    seclction[i].selected=true;
                }
            }

            document.getElementById("epic").src="__STATIC__/assest/images/"+pic;
            document.getElementById("eintro").value=intro;
            document.getElementById("euploadtime").value=uploadtime;
        }
    </script>
    <!-- Custom Js -->
    <script src="__STATIC__/assest/js/custom-scripts.js"></script>


</body>
</html>
